package com.example.ceshi.utils;

import android.app.Activity;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class DestroyActivityUtil {
    private static Map<String, Activity> destoryMap=new HashMap<String, Activity>();


    public static void addDestoryActivityToMap(Activity activity,String activityName){
        destoryMap.put(activityName,activity);
    }

    public static void destoryActivity(String activityName){
        Set<String> keySet=destoryMap.keySet();
//        LogUtil.i
        if(keySet.size()>0){
            for(String key:keySet){
                if(activityName.equals(key)){
                    destoryMap.get(key).finish();
                }
            }
        }
    }
}
